<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
*{font-family:Tahoma, Arial, Helvetica, Sans-serif,"宋体";}
table{
	width:85%;
	margin:0px auto;
	font:Georgia 11px;
	font-size:12px;
	color:#333333;
	text-align:center;
	border-collapse:collapse;/*细线表格代码*/
}
table td{
	border:1px solid #999;/*细线表格线条颜色*/
	height:22px;
}
caption{text-align:center;font-size:12px;font-weight:bold;margin:0 auto;}
tr.t1 td {background-color:#fff;}
tr.t2 td {background-color:#eee;}
tr.t3 td {background-color:#ccc;}
th,tfoot tr td{font-weight:bold;text-align:center;background:#c5c5c5;}
th{line-height:30px;height:30px;}
tfoot tr td{background:#fff;line-height:26px;height:26px; border:1px solid #999;}
thead{border:1px solid #999;}
thead tr td{text-align:center;}
a{
	text-decoration:none;
	}
	img{
		border:0px;}
-->
</style>
<script src="../admin_core/templates/admin/js/list.js"></script>
<script type="text/javascript"><!--
function selectPage(obj)
{

	var value = obj.value;
	document.location.href="controlLs.php?action=#{$action}#&page="+value+"&countPage=#{$countPage}#&count=#{$count}#&wt_id=#{$wt_id}#&zy_name=#{$zy_name}#&xs_id=#{$xs_id}#&ls_id=#{$ls_id}#&bj_id=#{$bj_id}#&zy_sate=#{$zy_sate}#&tj_date=#{$tj_date}#&start_time=#{$start_time}#&end_time=#{$end_time}#";
	}

	function undoTime(obj)
	{

		if(obj.value=="0")
		{
			
	document.getElementById('time').style.display='none';
	document.getElementById('searchtype').style.marginLeft="250px";
		}
		else 
		{
	document.getElementById('searchtype').style.marginLeft="0px";
	document.getElementById('time').style.display='table-row';
	
			}
		}
		function readHWDetails(hwId)
		{
			window.open('../readHW.php?hwId='+hwId,'作业信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			}
			function checkStudentDetail(xsId)
	{
		window.open('../readStudentDetail.php?xsId='+xsId,'学生信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
		}
		function checkSubmitDetail(hwId)
	{
		window.open('../submitHW.php?hwId='+hwId,'提交信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
		}
		function getStudentList(bjId)
	{
		window.open('../getStudentListByBJ.php?bjId='+bjId,'班级详细信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
		}
		function readZy(zyId)
		{
			window.open('../readZY.php?zyId='+zyId,'查看信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			}
		var xmlHttp;
	function setXmlHttpRequest()
{
	if(window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
		else if(window.XMLHttpRequest)
		{
			xmlHttp = new XMLHttpRequest();
			}
	}
	
	function ajaxFun(url,funName)
	{
		setXmlHttpRequest();
		url = encodeURI(url);
		xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange = funName;
		xmlHttp.send(null);
		}
		
//异步访问服务器获取对应学院的专业列表
		function getZhy()
		{
			var xyId = document.getElementById('xyId').value;
			document.getElementById('bjSelect').innerHTML = "<select name='bjId' id='bjId' style='width:140px; height:20px; color:#09C; border:#999 1px solid;' onchange='getXs()'><option value='none'>设定搜索的班级</option></select>";
			document.getElementById('xsSelect').innerHTML = "<select name='bjSelect' id='bjSelect' style='width:140px; height:20px; color:#09C; border:#999 1px solid;'><option value='none'>设定搜索的学生</option></select>";
			if(xyId!='none')
			{
			url = "controlLs.php?action=getZhyAjax&xyId="+xyId;
			ajaxFun(url,setZhy);
}
else
{
	document.getElementById('zhySelect').innerHTML = "<select name='zhyId' id='zhyId' style='width:140px; height:20px; color:#09C; border:#999 1px solid;' onchange='getBj()'><option value='none'>设定搜索的专业</option></select>";
	}
		}
function setZhy()
{
	if(xmlHttp.readyState == 4)
				{
					if(xmlHttp.status == 200)
					{
						document.getElementById('zhySelect').innerHTML=xmlHttp.responseText;;
						
						}
					}	
	}
	
	//end
	
	//异步访问服务器，获取对应专业的班级
	function getBj()
	{
		var zhyId = document.getElementById('zhyId').value;
		document.getElementById('xsSelect').innerHTML = "<select name='bjSelect' id='bjSelect' style='width:140px; height:20px; color:#09C; border:#999 1px solid;'><option value='none'>设定搜索的学生</option></select>";
			if(zhyId!='none')
			{
			url = "controlLs.php?action=getBjAjax&zhyId="+zhyId;
			ajaxFun(url,setBj);
			
}
else
{
	document.getElementById('bjSelect').innerHTML = "<select name='bjSelect' id='bjSelect' style='width:140px; height:20px; color:#09C; border:#999 1px solid;' onchange='getXs()'><option value='none'>设定搜索的班级</option></select>";
	}

	}
function setBj()
{
	if(xmlHttp.readyState == 4)
				{
					if(xmlHttp.status == 200)
					{
						document.getElementById('bjSelect').innerHTML=xmlHttp.responseText;;
						
						}
					}	
	}
		
		//end
		//异步访问服务器，获得对应班级的学生
			function getXs()
	{
		var bjId = document.getElementById('bjId').value;
			if(bjId!='none')
			{
			url = "controlLs.php?action=getXsAjax&bjId="+bjId;
			ajaxFun(url,setXs);
}
else
{
	document.getElementById('xsSelect').innerHTML = "<select name='bjSelect' id='bjSelect' style='width:140px; height:20px; color:#09C; border:#999 1px solid;'><option value='none'>设定搜索的学生</option></select>";
	}
	}
function setXs()
{
	if(xmlHttp.readyState == 4)
				{
					if(xmlHttp.status == 200)
					{
						document.getElementById('xsSelect').innerHTML=xmlHttp.responseText;;
						
						}
					}	
	}
		
		//end
		function search()
		{
			var bjId = document.getElementById('bjId').value;
			var xsId = document.getElementById('xsId').value;
			var wtId = document.getElementById('wtId').value;
			var searchtype = document.getElementById('searchway').value;
			var start_time = document.getElementById('start_time').value;
			var end_time  = document.getElementById('end_time').value;
			var zy_name = document.getElementById('zy_name').value;
			if(bjId=='none')
			{
				bjId=0;
				}
				if(xsId=='none')
				{
					xsId=0;
					}
					if(wtId=='none')
					{
						wtId=0;
						}
						if(searchtype==1)
						{
						if(start_time=="")
							{
								alert("请选择一个时间上限！");
								document.getElementById('start_time').focus();
								return ;
								}else if(end_time =="")
								{
									alert("请选择一个时间下限！");
								document.getElementById('end_time').focus();
								return ;
									}	
							}
							else 
							{
								searchtype=0;
								start_time=0;
								end_time=0;
								}
								if(zy_name=="")
								{
									zy_name="null";
									}
								
			document.location.href="controlLs.php?action=#{$action}#&wt_id="+wtId+"&zy_name="+zy_name+"&xs_id="+xsId+"&ls_id=#{$ls_id}#&bj_id="+bjId+"&zy_sate=#{$zy_sate}#&tj_date="+searchtype+"&start_time="+start_time+"&end_time="+end_time;
			}
		
--></script>
<script type="text/javascript" src="date/WdatePicker.js"></script>
</head>

<body style="text-align:center;" >
<center>
<br />
<fieldset style="width:1110px;">
<legend><span style="color:#000; font-size:13px; font-weight:bold;"><img src="images/search_16x16.gif" width="16" height="16" />&nbsp;搜索#{if $action=='getUndoHW'}#我未审核#{else if $action == 'getDoneHW'}#我已审核#{else}#需重做#{/if}#学生作业
</span></legend>
<div style="clear:both; height:5px;">
</div>
<span style="font-size:12px; font-weight:bold;">
<span style="float:left; margin-left:50px;">
搜索条件（指定到班级才能有效搜索）：
<select name="xyId" id="xyId" style="width:150px; height:20px; color:#09C; border:#999 1px solid;" onchange="getZhy()">
  <option value="none">设定搜索的学院/部门</option>
  
#{foreach from=$xyList item=xy}#

  <option value="#{$xy->getXy_id()}#">#{$xy->getXy_name()}#</option>
  
#{/foreach}#

</select>
<font color="#000000" style="font-weight:bolder;">--></font>
<span id="zhySelect">
<select name="zhyId" id="zhyId" style="width:140px; height:20px; color:#09C; border:#999 1px solid;" onchange="getBj()">
<option value="none">设定搜索的专业</option>
</select>
</span>
<font color="#000000" style="font-weight:bolder;">--></font><span id="bjSelect">
<select name="bjId" id="bjId" style="width:140px; height:20px; color:#09C; border:#999 1px solid;">
  <option value="none">设定搜索的班级</option>
</select>
</span><font color="#000000" style="font-weight:bolder;">--></font>
<span id="xsSelect">
<select name="xsId" id="xsId" style="width:140px; height:20px; color:#09C; border:#999 1px solid;">
<option value="none">设定搜索的学生</option>
</select>
</span>
</span>
<div style="clear:both; height:10px;">
</div>
<span style="float:left; margin-left:50px;">
选择你已发布的作业：<select name="wtId" id="wtId" style="width:140px; height:20px; color:#09C; border:#999 1px solid; ">
<option value="none">设定搜索的作业</option>
  #{foreach from=$wtList item=wt}#
  <option value="#{$wt->getWt_id()}#">#{$wt->getWt_name()|truncate:30:"...."}#</option>
  #{/foreach}#
</select>
</span>
<div style=" clear:both; height:5px;">
</div>

 <span style="float:left; margin-left:50px;">
 设定提交作业时间进行搜索（必须选择‘设定作业提交时间’才能有效）：
 <select name="searchway" id="searchway" style="width:140px; height:20px; color:#09C; border:#999 1px solid; " onchange="if(this.value==1) {document.getElementById('start_time').focus();}"  >
   <option value="0" > 常规搜索 </option>
   <option value="1" >设定作业提交时间</option>
 </select>
时间上限：
 <input  type="text" name="start_time" id="start_time" readonly="readonly"  class="Wdate"onfocus="var after=$dp.$('end_time');WdatePicker({onpicked:function(){after.focus();},maxDate:'#F{$dp.$D(\'end_time\')}'})"
 style="width:130px; height:20px; color:#09C; " />
 时间下限：
 <input  type="text" name="end_time" id="end_time" readonly="readonly"  class="Wdate" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'start_time\')}'})" style="width:130px; height:20px; color:#09C;" >
 </span>
 <div style="clear:both; height:10px;">
 </div>
<span style="float:left; margin:0px; float:left; margin-left:50px;">
请输入作业名或者作业名包含的关键词：
<input  type="text" name="zy_name" id="zy_name" 
 style="width:180px; height:20px; color:#09C; border:#999 1px solid;" />&nbsp;&nbsp;
 <input type="button" value=" 搜 索 " onclick="search()" style="width:80px; height:25px;" />
 </span>
</span>
</fieldset>
<div style="clear:both; height:10px;">
</div>
<fieldset style="width:1110px;;">
<legend><img src="images/311.gif"/>&nbsp;<span style="color:#333; font-size:15px; font-weight:bold;">#{if $action=='getUndoHW'}#我未审核#{else if $action=='getDoneHW'}#我已审核#{else}#需重做#{/if}#作业列表</span></legend>
<form id="selectForm" action="controlLs.php?action=deleteHW" method="post">


<table width="100%">

  <thead>
    <tr>
     
      <th >作业标题</th>
      
      <th width="15%">提交时间</th>
      <th width="12%">提交作业的学生</th>
       <th width="25%">学生班级</th>
       #{if $action =='getUndoHW'}#
       <th width="25%" >操作</th>
       #{else}#
        <th width="5%" >分数</th>
         <th width="25%" >操作</th>
         #{/if}#
    </tr>
  </thead>
#{if $count==0}#
<tr>
<td style="text-align:center; " colspan="#{if $action =='getUndoHW'}#5#{else}#6#{/if}#"> 暂无数据！</td>
</tr>
#{else}#

    #{foreach from=$list item=zy}#
      <tr onmousemove="changeBackColor(this)" onmouseout="removeBackColor(this)">
     
      <td align="left" style="cursor:pointer; padding-left:5px;" onclick="readHWDetails(#{$zy->getWt()->getWt_id()}#)" title="点击查看详细信息" >#{$zy->getZy_name()|truncate:30:"...."}#</td>
      
      <td width="15%" align="center">#{$zy->getTj_date()|date_format:'%Y-%m-%d'}#</td>
      <td width="10%" align="left" style="padding-left:5px; cursor:pointer;" onclick="checkStudentDetail(#{$zy->getXs()->getXs_id()}#)" title="查看该生详细信息">#{$zy->getXs()->getXs_name()}#</td>
       <td width="25%"  align="left" style="padding-left:5px; cursor:pointer;" onclick="getStudentList(#{$zy->getBj()->getBj_id()}#)" title="查看该班详细信息">
      【#{$zy->getBj()->getZhy()->getZhy_name()}#】#{$zy->getBj()->getBj_name()}#
       </td>
       #{if $action =='getUndoHW'}#
       <td width="25%">
   【<img src="images/backup_(edit)_16x16.gif" width="14" height="14" />&nbsp;<a href="../confirmZY.php?zyId=#{$zy->getZy_id()}#" title="审核该作业">审核该作业</a>】【<a href="#" onclick="checkSubmitDetail(#{$zy->getWt()->getWt_id()}#)" title="获取详细信息" ><img src="images/view_16x16.gif" title="获取详细信息"  width="14" height="14"/>&nbsp;查看提交情况</a>】
       </td>
       #{else}#
       <td width="5%">
       #{$zy->getZy_fs()}#分
       </td>
       <td width="25%">
       【<img src="images/backup_(edit)_16x16.gif" width="14" height="14" />&nbsp;<a href="#" onclick="readZy(#{$zy->getZy_id()}#)" title="查看该作业">查看该作业</a>】【<a href="#" onclick="checkSubmitDetail(#{$zy->getWt()->getWt_id()}#)" title="获取详细信息" ><img src="images/view_16x16.gif" title="获取详细信息"  width="14" height="14"/>&nbsp;查看提交情况</a>】
       </td>
            #{/if}#

      </tr>
 #{/foreach}#
#{/if}#
  <tr>
  <td colspan="
   #{if $action =='getUndoHW'}#5#{else}#6#{/if}#" align="right" style="text-align:right; border: #999 1px solid;">
  共有#{$count}#条记录 总共有#{$countPage}#页 当前为#{$start}#-#{$end}#条 在第#{$nowPage}#页
  #{if $nowPage==1}#
 上一页
  #{else}#
  <a href="controlLs.php?action=#{$action}#&page=#{$nowPage-1}#&countPage=#{$countPage}#&count=#{$count}#&wt_id=#{$wt_id}#&zy_name=#{$zy_name}#&xs_id=#{$xs_id}#&ls_id=#{$ls_id}#&bj_id=#{$bj_id}#&zy_sate=#{$zy_sate}#&tj_date=#{$tj_date}#&start_time=#{$start_time}#&end_time=#{$end_time}#">上一页</a>
  #{/if}#

  #{if $countPage>$nowPage}#
   <a href="controlLs.php?action=#{$action}#&page=#{$nowPage+1}#&countPage=#{$countPage}#&count=#{$count}#&wt_id=#{$wt_id}#&zy_name=#{$zy_name}#&xs_id=#{$xs_id}#&ls_id=#{$ls_id}#&bj_id=#{$bj_id}#&zy_sate=#{$zy_sate}#&tj_date=#{$tj_date}#&start_time=#{$start_time}#&end_time=#{$end_time}#"> 下一页</a>
  #{else}#
  下一页
  #{/if}#
  跳至<select onchange="selectPage(this)">
  #{section loop=$countPage name=a}#
<option value="#{$smarty.section.a.iteration}#" #{if $smarty.section.a.iteration==$nowPage}# selected="selected"#{/if}#>#{$smarty.section.a.iteration}#页</option>
#{/section}#
</select>
  &nbsp;&nbsp;
  
  </td>
  </tr>
 
  
</table>
</form>
</fieldset>
</center>
</body>
</html>
